//          https://ac.nowcoder.com/acm/problem/16617




#include <iostream>
using namespace std;

int main()
{
    char ISBN[14];
    int sum = 0, k = 1;
    cin >> ISBN;
    for (int i = 0; i < 12; i++)
        if (ISBN[i] >= '0' && ISBN[i] <= '9')
        {
            sum += (ISBN[i] - '0') * k;
            k++;
        }
    sum %= 11;
    char ans = '0';
    if (sum == 10)
        ans = 'X';
    else
        ans = sum + '0';
    if (ISBN[12] == ans)
        cout << "Right";
    else
    {
        ISBN[12] = ans;
        cout << ISBN << endl;
    }
    return 0;
}